The present invention relates to an image processing method and apparatus, and an image processing program. In particular, the present invention relates to an image processing method and apparatus capable of performing edge portion extraction with precision and of performing sharpness enhancement processing at high speed, and to an image processing program for implementing the image processing method.
Digital photoprinters have been put into practical use which are each a digital color image reproduction system in which an image signal for each of red (R), green (G), and blue (B), which are the three primary colors, is obtained by photoelectrically reading a color image recorded on a negative film, a reversal film, a color print, or the like using a photoelectric conversion element such as a CCD, the image signal is converted into a digital signal, and various kinds of digital image processing is performed on the digital signal to reproduce the image through outputting onto a recording material such as color paper, or displaying on an image display means such as a CRT.
With such a digital photoprinter, even when a color image is photographed under an inappropriate photographing condition such as underexposure or overexposure, and is recorded on a negative film, a reversal film, a color print, or the like, it is possible to reproduce the image as a color image having a desired color and gradation by performing image processing on an obtained original image signal. In addition, it is also possible to reproduce the color image recorded on the negative film, the reversal film, the color print, or the like as a color image having a different color and gradation as desired.
As such image processing, for instance, sharpness enhancement (sharpening) processing and graininess suppression processing have conventionally been known with which image degradation such as sharpness degradation of an image obtained with a scanner, a photographing camera, a printer, or the like is recovered. To do so, edge portions are first extracted using a template and the graininess suppression processing or the sharpness enhancement processing is then performed using an unsharpness mask (USM) or a Laplacian filter. In this case, however, the processing is performed on the whole of the image, so that there is a disadvantage in that although the sharpness of the image is improved, noises (undesired components) such as graininess are also enhanced accordingly.
In view of the above-mentioned problem, as a technique of suppressing the noises in flat portions and enhancing only edge components, for instance, a selective image sharpening method is known with which instead of uniformly enhancing the whole of an image, the degree of unsharp masking is partially controlled using output image data of a line detection operator with respect to an original image (see “Handbook of Image Analysis” published by University of Tokyo Press in 1991, for instance).
It is described in “Handbook of Image Analysis” that it becomes possible to detect edge strength accurately when direction-specific templates are used as an edge strength calculation means for extracting edge portions. However, there still has a problem in that when the number of directions is increased, the number of the direction-specific templates is increased, leading to the increase of the time for computation.
Also, when a mask size is increased in accordance with the levels and sizes of noises, graininess, and the like, there occurs a problem in that image density gradients in non-edge portions such as a shaded portion of the skin of a human subject are erroneously detected as edges and also it becomes impossible to pick up textures that are smaller than the mask size.